/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prototipos;

import java.awt.Cursor;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JOptionPane;

/**
 *
 * @author Hugo
 */
public class Podio_panel extends javax.swing.JPanel {

    /**
     * Creates new form Podio_panel
     */
    Jogo j;
    public Podio_panel(Jogo j) {
        this.j=j;
        initComponents();
        inicializa_top();
    }

    public Cursor setCursor(){
        Image image;
        Toolkit tk = Toolkit.getDefaultToolkit();
        
        image = tk.getImage(getClass().getResource("/imagens/atras.png"));
        
        
        Cursor cursor = tk.createCustomCursor(image, getLocation(), "meuCursor");
        
        
        return cursor;
    }
    
    public void inicializa_top(){
        
        lbl_nome_1.setText(j.getJogadorTop(0).getNome());
        lbl_icon_1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/icons/"+j.getJogadorTop(0).getImagem())));
        
        lbl_nome_2.setText(j.getJogadorTop(1).getNome());
        lbl_icon_2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/icons/"+j.getJogadorTop(1).getImagem())));
        
        lbl_nome_3.setText(j.getJogadorTop(2).getNome());
        lbl_icon_3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/icons/"+j.getJogadorTop(2).getImagem())));
        
        j.limpaTop();//limpa o array co top
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbl_icon_3 = new javax.swing.JLabel();
        lbl_nome_3 = new javax.swing.JLabel();
        lbl_icon_1 = new javax.swing.JLabel();
        lbl_icon_2 = new javax.swing.JLabel();
        lbl_nome_1 = new javax.swing.JLabel();
        lbl_nome_2 = new javax.swing.JLabel();
        bt_res = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setPreferredSize(new java.awt.Dimension(1000, 650));
        setLayout(null);

        lbl_icon_3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbl_icon_3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/icons/interrogacao.png"))); // NOI18N
        add(lbl_icon_3);
        lbl_icon_3.setBounds(590, 280, 150, 120);

        lbl_nome_3.setFont(new java.awt.Font("Alice in Wonderland", 0, 30)); // NOI18N
        lbl_nome_3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbl_nome_3.setText("filipe queiros");
        add(lbl_nome_3);
        lbl_nome_3.setBounds(570, 390, 160, 35);

        lbl_icon_1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbl_icon_1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/icons/interrogacao.png"))); // NOI18N
        add(lbl_icon_1);
        lbl_icon_1.setBounds(410, 190, 128, 120);

        lbl_icon_2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbl_icon_2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/icons/interrogacao.png"))); // NOI18N
        add(lbl_icon_2);
        lbl_icon_2.setBounds(230, 280, 128, 120);

        lbl_nome_1.setFont(new java.awt.Font("Alice in Wonderland", 0, 30)); // NOI18N
        lbl_nome_1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbl_nome_1.setText("hugo duarte");
        add(lbl_nome_1);
        lbl_nome_1.setBounds(420, 310, 130, 30);

        lbl_nome_2.setFont(new java.awt.Font("Alice in Wonderland", 0, 30)); // NOI18N
        lbl_nome_2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbl_nome_2.setText("carlos nogueira");
        add(lbl_nome_2);
        lbl_nome_2.setBounds(230, 400, 150, 35);

        bt_res.setBorderPainted(false);
        bt_res.setContentAreaFilled(false);
        bt_res.setCursor(setCursor());
        bt_res.setFocusPainted(false);
        bt_res.setFocusable(false);
        bt_res.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_resActionPerformed(evt);
            }
        });
        add(bt_res);
        bt_res.setBounds(100, 500, 70, 60);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/podio.png"))); // NOI18N
        add(jLabel1);
        jLabel1.setBounds(0, -20, 1000, 650);
    }// </editor-fold>//GEN-END:initComponents

    private void bt_resActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_resActionPerformed
        j.getEcra().getPodio_panel().setVisible(false);
        j.setEstados(new Estado_Perfil(j,j.getTipoJog()));
    }//GEN-LAST:event_bt_resActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bt_res;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel lbl_icon_1;
    private javax.swing.JLabel lbl_icon_2;
    private javax.swing.JLabel lbl_icon_3;
    private javax.swing.JLabel lbl_nome_1;
    private javax.swing.JLabel lbl_nome_2;
    private javax.swing.JLabel lbl_nome_3;
    // End of variables declaration//GEN-END:variables
}
